
#ifndef XWINDOW_H_
#define XWINDOW_H_

#if defined(__IPHONE_3_0)

#include "Core.h"

#include "Xlib.h"
#include "Window.h"

namespace p2
{

class XWindow : public Window
{
public:
	XWindow(p2WindowCreateStruct const& cs);
	virtual ~XWindow();

	int32 create();
	void show(bool show = true) const {}
	void queryCursor(Point<int32>& position) const;
	void swapBuffers() const;
	int32 processContinue();

private:
	int32 create(char const* className, char const* windowName);
	bool createContext();
	void deleteContext();

public:
	Display* _dpy;
	Window _win;
	GLXContext _ctx;
	Atom _wmDeleteWindow;
	bool _initialised;
};

}

#endif  //#if defined(__IPHONE_3_0)

#endif	//XWINDOW_H_
